﻿using System;
using System.Web;
using System.Data;
using AliCMS.SystemModule;

namespace AliCMS.Lib
{
    public class SystemPageBase : AdminPageBase
    {
        public SystemPageBase(string pathInTemplate)
            : base(pathInTemplate)
        {
        }

        #region Properties
        protected DataRow Instance
        {
            get
            {
                if (_instance == null)
                    _instance = Manager.Instances.Select(Alias.Instance.InnerID + "=" + InstanceID)[0];
                
                return _instance;
            }
        }
        protected string AdminPath
        {
            get
            {
				return Channel[Alias.Channel.Path] + "1" + Manager.GetModulePath("AliCMS.SystemModule") + "template/" + Channel[Alias.Channel.TemplatePath] + "page/";
            }
        }
        protected string AdminBrowserURL
        {
            get
            {
                return AdminPath + "file_manager/select.aspx";
            }
        }
        #endregion

        #region Fields
        private DataRow _instance;
        #endregion
    }
}
